import java.util.Random;
import java.util.Scanner;

public class GuessNum {
    //猜数字游戏
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        Random random = new Random();
        int randNum = random.nextInt(100);//随机生成数的范围[0,100)
        while (true) {
            System.out.println("请输入你要猜的数字：");
            int number = scan.nextInt();
            if (number < randNum) {
                System.out.println("猜小了");
            } else if (number == randNum) {
                System.out.println("恭喜你，猜对啦");
                break;
            } else {
                System.out.println("猜大了");
            }
        }
    }
}